<template>
	<view class="recruit">
		<uni-swiper-dot class="uni-swiper-dot-box" @clickItem=clickItem :info="info" :current="current" :mode="mode"
			:dots-styles="dotsStyles" field="content">
			<swiper class="swiper-box" @change="change" :current="swiperDotIndex">
				<swiper-item v-for="(item, index) in jobList" :key="index">
					<view style="border-radius: 20px;height: 200px;" class="swiper-item"
						:class="'swiper-item' + index">
						<image :src="item.url" mode="aspectFill" style="width: 100%;border-radius: 20px;"></image>
						
					</view>
				</swiper-item>
			</swiper>
		</uni-swiper-dot>
		
		<view style="height: 20px; background-color: #f4f8f9;">
		</view>
		
		<text style=" margin-left: 10px;font-weight: 800; font-size: 20px; border-bottom: 2px solid #008c8c;">附近的工作</text>
		
		<view class="box">
			<view class="content">
				
				<view v-for="(item,index) in work" :key="item.id">
					<view class="partOne" @click="getMoreDetail(item.id)">
						<view class="container">
							<text class="work">{{item.workname}}</text>
							<text class="money">{{item.payment}}</text>
						</view>
						<view class="body">
							<view class="body1">以前干过</view>
							<view class="body2">有些经验</view>
							<view class="body3">很熟练</view>
							<view class="body4">随叫随到</view>
						</view>
						
						<view class="partOne_middle">
							<view class="image">
							<image class="borderImage"  :src="'http://192.168.0.112:8080'+item.userimage"></image>
						
						</view>
							<view class="description">联系人·{{item.username}}</view>
							<view class="description2">{{item.location}}</view>
						</view>
						
					</view>
		
					<view style="height: 10px; background-color: #f4f8f9;">
					</view>
					
					</view>
		
					
					</view>
					
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				title: 'Hello',
				work: [],
				imgSrc: require('../../../static/img/two.png'),
				extraIcon: {
					color: '#4cd964',
					size: '22',
					type: 'gear-filled'
				},
				
				jobList: [{
						url: "../../../static/img/nearbyOne.png"
					},
					{
						url: "../../../static/img/one.png"
					},
					{
						url: "../../../static/img/three.png"
					},
				],
				
				info: [{
										colorClass: 'uni-bg-red',
										url: 'https://imgcdpee.cdpee.org.cn/4028855880d08fae0180d50b13740261.jpg',
										content: '内容 A'
									},
									{
										colorClass: 'uni-bg-green',
										url: 'https://web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg',
										content: '内容 B'
									},
									{
										colorClass: 'uni-bg-blue',
										url: 'https://web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg',
										content: '内容 C'
									}
								],
				
			
				dotStyle: [{
										backgroundColor: 'rgba(0, 0, 0, .3)',
										border: '1px rgba(0, 0, 0, .3) solid',
										color: '#fff',
										selectedBackgroundColor: 'rgba(0, 0, 0, .9)',
										selectedBorder: '1px rgba(0, 0, 0, .9) solid'
									},
									{
										backgroundColor: 'rgba(255, 90, 95,0.3)',
										border: '1px rgba(255, 90, 95,0.3) solid',
										color: '#fff',
										selectedBackgroundColor: 'rgba(255, 90, 95,0.9)',
										selectedBorder: '1px rgba(255, 90, 95,0.9) solid'
									},
									{
										backgroundColor: 'rgba(83, 200, 249,0.3)',
										border: '1px rgba(83, 200, 249,0.3) solid',
										color: '#fff',
										selectedBackgroundColor: 'rgba(83, 200, 249,0.9)',
										selectedBorder: '1px rgba(83, 200, 249,0.9) solid'
									}
								],
								
					modeIndex: -1,
									styleIndex: -1,
									current: 0,
									mode: 'default',
									dotsStyles: {},
									swiperDotIndex: 0
				
			}
		},
		onLoad(option) {
			
		 console.log(option)
		 this.GetWorkList(option.longtitude,option.latitude);
		
		},
		
		// onShow() {
           
		// },
		methods: {
			
			GetWorkList(longtitude,latitude){
				uni.request({
					url:getApp().globalData.baseUrl+'/NearlyWork/'+ longtitude +'/'+latitude ,
					method:'GET',
					success: (res) => {
						console.log(res.data)
						this.work = res.data.success
						
					}
				})
			},
			
			getMoreDetail(id){
				uni.navigateTo({
					url:'/pages/page/MyWorkDescription/MyWorkDescription?id=' + id
				})
			},
			
			change(e) {
							this.current = e.detail.current
			},
			
			

		}
	}
</script>

<style>
	.recruit {
		background-color: #fbfbfd;
		display: block;
	}
	
	.search {
		top: 20px;
		align-items: center;
		justify-content: center;
		height: 100px;
		width: 100%;
		position: relative;
	}
	.searchInput {
		left: 10px;
		width: 80%;
		display: block;
		position: absolute;
	}
	.searchImage {
		width: 10%;
		display: block;
		position: absolute;
		right: 10px;
		top: 12px;
	}

	.searchImage image {
		height: 30px;
		width: 30px;
	}
	
	.box{
		margin-top: 30px;
		background-color: #f4f8f9;
		width: 100%;
	}
	
	.content{
		background-color: #ffffff;
		margin-left: 10px;
		margin-right: 10px;
		border-radius: 8px;
		border-bottom-right-radius: 8px;
		box-shadow: 0px 0px 5px #ccc; 
	}
	
	.content .partOne{
		height: 200px;
	}
	
	.middle{
		height: 40px;
		width: 100%;
		position: relative;
		margin-bottom: 10px;
		background-color: #fbfbfd;
	}
	.middle .recommend{
		position: absolute;
		left: 20px;
		font-weight: 300;
		top: 10px;
	}
	
	.middle .play{
		position: absolute;
		left: 100px;
		font-weight: 300;
		top: 10px;
	}
	
	.middle .click{
		top: 8px;
		position: absolute;
		left: 100px;
		font-weight: 800;
		font-size: 20px;
		border-bottom: 2px solid #008c8c;
	}
	
	.content .partOne{
		height: 200px;
		position: relative;
		width: 100%;
		margin-bottom: 10px;
	}
	
	.content .partOne .container{
		position: absolute;
		height: 20px;
		left: 10px;
		top: 10px;
		width: 100%;
	}
	
	.content .partOne .work{
		position: absolute;
		font-weight: bold;
		left: 0px;
		color: #212121;
	}
	.content .partOne .money{
		position: absolute;
		font-weight: bold;
		right: 20px;
		color: #839cef;
	}
	
	.content .partOne .body{
		position: absolute;
		height: 20px;
		width: 80%;
		top: 40px;
	}
	
	.content .partOne .body .body1{
		position: absolute;
		left: 10px;
		background-color: #f4f6f8;
		font-size: 15px;
		font-weight: 330;
	}
	.content .partOne .body .body2{
		position: absolute;
		left: 80px;
		background-color: #f4f6f8;
		font-size: 15px;
		font-weight: 330;
	}
	.content .partOne .body .body3{
		position: absolute;
		left: 150px;
		background-color: #f4f6f8;
		font-size: 15px;
		font-weight: 330;
	}
	.content .partOne .body .body4{
		position: absolute;
		left: 220px;
		background-color: #f4f6f8;
		font-size: 15px;
		font-weight: 330;
	}
	
	.partOne_middle{
		height: 80px;
	}
	.partOne_middle .image{
		position: absolute;
		top: 70px;
		left: 10px;
	}
	
	.partOne_middle .description {
		position: absolute;
		top: 150px;
		left: 50px;
	}
	
	.partOne_middle .description2{
		position: absolute;
		top: 150px;
		right: 20px;
	}
	
	.partOne .footer .end{
		position: absolute;
		top: 180px;
		left: 10px;
		bottom: 3px;
	}
	.borderImage{
		border-radius: 50%; 
		height: 45px; 
		width: 45px;
		position: absolute;
		left: -6px;
		top: 68px;
	}
	
	.image .borderImage2{
		position: absolute;
		width: 80px;
		height: 80px;
		left: 200px;
	}
	
	.swiper-box {
			height: 200px;
		}
	
		.swiper-item {
			/* #ifndef APP-NVUE */
			display: flex;
			/* #endif */
			flex-direction: column;
			justify-content: center;
			align-items: center;
			height: 200px;
			color: #fff;
		}
	
		.swiper-item0 {
			background-color: #cee1fd;
		}
	
		.swiper-item1 {
			background-color: #b2cef7;
		}
	
		.swiper-item2 {
			background-color: #cee1fd;
		}
	
		.image {
			width: 750rpx;
		}
	
		/* #ifndef APP-NVUE */
		::v-deep .image img {
			-webkit-user-drag: none;
			-khtml-user-drag: none;
			-moz-user-drag: none;
			-o-user-drag: none;
			user-drag: none;
		}
	
		/* #endif */
	
		@media screen and (min-width: 500px) {
			.uni-swiper-dot-box {
				width: 400px;
				margin: 0 auto;
				margin-top: 8px;
			}
	
			.image {
				width: 100%;
			}
		}
	
		.uni-bg-red {
			background-color: #ff5a5f;
		}
	
		.uni-bg-green {
			background-color: #09bb07;
		}
	
		.uni-bg-blue {
			background-color: #007aff;
		}
	
		.example-body {
			/* #ifndef APP-NVUE */
			display: flex;
			/* #endif */
			flex-direction: row;
			padding: 20rpx;
		}
	
		.example-body-item {
	
			flex-direction: row;
			justify-content: center;
			align-items: center;
			margin: 15rpx;
			padding: 15rpx;
			height: 60rpx;
			/* #ifndef APP-NVUE */
			display: flex;
			padding: 0 15rpx;
			/* #endif */
			flex: 1;
			border-color: #e5e5e5;
			border-style: solid;
			border-width: 1px;
			border-radius: 5px;
		}
	
		.example-body-item-text {
			font-size: 28rpx;
			color: #333;
		}
	
		.example-body-dots {
			width: 16rpx;
			height: 16rpx;
			border-radius: 50px;
			background-color: #333333;
			margin-left: 10rpx;
		}
	
		.active {
			border-style: solid;
			border-color: #007aff;
			border-width: 1px;
		}
		
		.swiper-box {
				height: 200px;
			}
		
			.swiper-item {
				/* #ifndef APP-NVUE */
				display: flex;
				/* #endif */
				flex-direction: column;
				justify-content: center;
				align-items: center;
				height: 200px;
				color: #fff;
			}
		
			.swiper-item0 {
				background-color: #cee1fd;
			}
		
			.swiper-item1 {
				background-color: #b2cef7;
			}
		
			.swiper-item2 {
				background-color: #cee1fd;
			}
		
			.image {
				width: 750rpx;
			}
		
			/* #ifndef APP-NVUE */
			::v-deep .image img {
				-webkit-user-drag: none;
				-khtml-user-drag: none;
				-moz-user-drag: none;
				-o-user-drag: none;
				user-drag: none;
			}
		
			/* #endif */
		
			@media screen and (min-width: 500px) {
				.uni-swiper-dot-box {
					width: 400px;
					margin: 0 auto;
					margin-top: 8px;
				}
		
				.image {
					width: 100%;
				}
			}
		
			.uni-bg-red {
				background-color: #ff5a5f;
			}
		
			.uni-bg-green {
				background-color: #09bb07;
			}
		
			.uni-bg-blue {
				background-color: #007aff;
			}
		
			.example-body {
				/* #ifndef APP-NVUE */
				display: flex;
				/* #endif */
				flex-direction: row;
				padding: 20rpx;
			}
		
			.example-body-item {
		
				flex-direction: row;
				justify-content: center;
				align-items: center;
				margin: 15rpx;
				padding: 15rpx;
				height: 60rpx;
				/* #ifndef APP-NVUE */
				display: flex;
				padding: 0 15rpx;
				/* #endif */
				flex: 1;
				border-color: #e5e5e5;
				border-style: solid;
				border-width: 1px;
				border-radius: 5px;
			}
		
			.example-body-item-text {
				font-size: 28rpx;
				color: #333;
			}
		
			.example-body-dots {
				width: 16rpx;
				height: 16rpx;
				border-radius: 50px;
				background-color: #333333;
				margin-left: 10rpx;
			}
		
			.active {
				border-style: solid;
				border-color: #007aff;
				border-width: 1px;
			}
	
</style>
